gpg: Set a limit of 5 to the number of keys imported from the WKD.
authorWerner Koch <wk@gnupg.org>
Thu, 11 Apr 2019 07:43:33 +0000 (09:43 +0200)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 22 Aug 2019 19:11:59 +0000 (20:11 +0100)
commit3a69788f69107d93607fd1f8ca10c2f56bc4bb83
treebc1cba24ef08827f99f7375938ce71378d2caa73
parent33ba9870c7a3ad64409a498c15f57db28e0f6515
gpg: Set a limit of 5 to the number of keys imported from the WKD.

* g10/import.c (import): Limit the number of considered keys to 5.
(import_one): Return the first fingerprint in case of WKD.
--

The Web Key Directory should carry only one key.  However, some
providers like to put old or expired keys also into the WKD.  I don't
thunk that this is a good idea but I heard claims that this is needed
for them to migrate existing key data bases.

This patch puts a limit on 5 on it (we had none right now) and also
fixes the issue that gpg could not work immediately with the requested
key because the code uses the fingerprint of the key to use the
imported key.  Now the first key is used.  On a second try (w/o
accessing the WKD) the regular key selection mechanism would be in
effect.  I think this is the most conservative approach.  Let's see
whether it helps.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit e9fcb0361ab4ef1f6fb0ea235f1b15667932aba2)

Gbp-Pq: Topic from-2.2.16
Gbp-Pq: Name gpg-Set-a-limit-of-5-to-the-number-of-keys-imported-from-.patch
g10/import.c